<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>车辆详情</title>
    <link rel="stylesheet" type="text/css" href="../css/login.css">
    <link rel="stylesheet" type="text/css" href="../js/swiper/swiper.min.css">
    <script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="../js/config.js"></script>
    <script type="text/javascript" src="../js/vue.js"></script>
    <script type="text/javascript" src="../js/filter.js"></script>
    <style type="text/css">
      .mSwiper-page{

        width: auto;
        background-color: rgba(0,0,0,0.6);
        border-radius: 4px;
        padding: 5px 10px;
        right: 10px;
        left: auto;
        color: #fff;
      }
      .swiper-container{
/*        width: 600px;
        height: 400px;*/
        min-height: 300px;
      }
    </style>
  </head>
  <body>
  
    <div style="max-width: 1300px;margin: auto">
    <div class="panel">
      <!-- <div class="title">头部信息</div> -->
      <div class="box">
<!-- 
          <div class="detial-left" >
            <img v-if="res.carImages[0]" v-bind:src="imgUrl + res.carImages[0].imageUrl">
            <img v-else="res.carImages[0]" src="../images/default.png">
          </div> -->
          <div class="detial-left">
            <div class="swiper-container" >
                <div class="swiper-wrapper" id="swiperTop">
<!--                     <div class="swiper-slide"><img src=""></div>
                    <div class="swiper-slide"><img src="http://env-pro.oss-cn-beijing.aliyuncs.com/images/ED25EC05-C4C9-4ACA-B286-99E00920750E.jpg?x-oss-process=image/resize,m_fill,w_800,h_600,limit_0"></div>
                    <div class="swiper-slide"><img src="http://env-pro.oss-cn-beijing.aliyuncs.com/images/ED25EC05-C4C9-4ACA-B286-99E00920750E.jpg?x-oss-process=image/resize,m_fill,w_800,h_600,limit_0"></div> -->
                </div>
                <!-- 如果需要分页器 -->
                <div class="swiper-pagination mSwiper-page"></div>
                <!-- 如果需要导航按钮 -->
                <div class="swiper-button-prev"></div>
                <div class="swiper-button-next"></div>
            </div>
          </div> 
          <div class="detial-right" id="detialTopRight">
            <h1>{{res.brand.brandName+' '+res.series.seriesName+' '+res.model.modelName}}</h1>
            <div>
              <p>
                <span>新车完税价：{{res.carTaxPrice || '-'}} 万元</span>
              </p>
              <p>
                <span>零售价：{{res.carRetailPrice || '-'}} 万元</span>
              </p>
            </div>
            <table class="detial-table">
              <tr>
                <td class="header">所属分店</td>
                <td>{{res.shop.shopName || '-'}}</td>
                <td class="header">库存号</td>
                <td>-</td>
              </tr>
              <tr>
                <td class="header">车架号</td>
                <td>{{res.carVin}}</td>
                <td class="header">车牌号</td>
                <td>{{res.carPlate}}</td>
              </tr>
              <tr>
                <td class="header">上牌日期</td>
                <td>{{res.carLicenceDate | filterGetDate}}</td>
                <td class="header">排量</td>
                <td>{{res.carDisplacement +' / '+res.carInletModel}}</td>
              </tr>
              <tr>
                <td class="header">表显里程</td>
                <td>{{res.carMileage}}</td>
                <td class="header">外观/内饰</td>
                <td>{{res.carOutColor+' / '+res.carInColor}}</td>
              </tr>
            </table>
          </div>
      </div>
    </div>
    </div>
<form class="cars-form" id="carsForm">
  <input type="hidden" name="marketId" v-bind:value="marketId">
  <input type="hidden" name="userId" v-bind:value="userId">
  <input type="hidden" name="carId" v-bind:value="res.carId">
    <div class="panel">
      <div class="title">收购信息</div>
      <div class="box">
       <div class="cell-car">
         <label>所属分店</label>
         <select v-bind:value="res.shop.shopId" name="shopId" disabled>
            <option v-for="shop in shopList" v-bind:value="shop.shopId" >{{shop.shopName}}</option>
         </select>
       </div>
       <div class="cell-car">
         <label>所属区域</label>
         <select v-bind:value="res.region.regionId" name="regionId" disabled>
            <option v-for="region in regionList" v-bind:value="region.regionId" >{{region.regionName}}</option>
          </select>
       </div>
       <div>
        <div class="cell-car">
           <label>品牌</label>
           <input type=""  v-bind:value="res.brand.brandName"  style="margin-right: 10px;" disabled>
           <input type=""  v-bind:value="res.series.seriesName" style="margin-right: 10px;" disabled>
           <input type="" v-bind:value="res.model.modelName" style="width: 300px;" disabled>
           <input type="hidden" name="brandId" v-bind:value="res.brand.brandId">
           <input type="hidden" name="seriesId" v-bind:value="res.series.seriesId">
           <input type="hidden" name="modelId" v-bind:value="res.model.modelId">
           
         </div>
       </div>
       
       <div class="cell-car">
         <label>表显里程</label>
         <div class="group-input"><input type="" name="carMileage" v-bind:value="res.carMileage" disabled><span>万公里</span></div>
       </div>
       <div class="cell-car">
         <label>实际里程</label>
         <div class="group-input"><input type="" name="carMileage" v-bind:value="res.carMileage" disabled><span>万公里</span></div>
       </div>

       <div class="cell-car">
         <label>钥匙数量</label>
         <div class="group-input"><input type="" name="carKeyNum" v-bind:value="res.carKeyNum" disabled><span>把</span></div>
       </div>
        <div class="cell-car">
          <label>首次上牌</label>
          <div class="group-radio"><input name="carLicenceState" type="radio" value="1" v-model="res.carLicenceState" disabled/>已经上牌</div> 
          <div class="group-radio"><input name="carLicenceState" type="radio" value="2" v-model="res.carLicenceState" disabled/>未上牌</div> 
          <div class="group-radio"><input name="carLicenceState" type="radio" value="3" v-model="res.carLicenceState" disabled/>新车</div> 
          <input type="month" name="carLicenceDate" v-bind:value="res.carLicenceDate | filterGetDate" :disabled="res.carLicenceState != 1" disabled>
        </div>
      </div>
    </div>
    <div class="panel">
      <div class="title">基本信息</div>
      <div class="box">
        <div class="cell-car">
          <label>宣传标题</label>
          <input type="" name="carTitle" v-bind:value="res.carTitle" disabled>
        </div>
<!--         <div class="cell-car">
          <label>库存编号</label>
          <input type="" name="">
        </div> -->
        <div class="cell-car">
          <label>车架号</label>
          <input type="" name="carVin" v-bind:value="res.carVin" disabled>
        </div>
        <div class="cell-car">
          <label>车型</label>
          <select v-bind:value="res.carTypeId" name="carTypeId"  disabled>
            <option  v-for="carType in carTypeList" v-bind:value="carType.carTypeId" >{{carType.carTypeName}}</option>
          </select>
        </div>
        <div class="cell-car">
          <label>车门数</label>
          <div class="group-input"><input type="" name="carDoorNum" v-bind:value="res.carDoorNum" disabled><span>门</span></div>
        </div>
        <div class="cell-car">
          <label>排气量</label>
          <div class="group-input">
            <input type="" name="carDisplacement" v-bind:value="res.carDisplacement+res.carInletModel" disabled>
          </div>

          <!-- <div class="group-checkbox" style="margin-left: 10px;"><input  type="checkbox" v-model="Tchecked"  />涡轮增压</div> -->
        </div>
        <div class="cell-car">
          <label>燃料类型</label>
          <select v-bind:value="res.carFuel" name="carFuel"  disabled>
            <option>汽油</option>
            <option>柴油</option>
            <option>电动</option>
            <option>混合</option>
            <option>其他</option>
          </select>
        </div>
        <div class="cell-car">
          <label>变速箱</label>
          <select v-bind:value="res.carGearbox" name="carGearbox"  disabled>
            <option>自动</option>
            <option>手动</option>
          </select>
        </div>
        <div class="cell-car">
          <label>排放标准</label>
          <select v-bind:value="res.carEnviron" name="carEnviron"  disabled>
            <option value="国I">国I</option>
            <option value="国II">国II</option>
            <option value="国III">国III</option>
            <option value="国IV">国IV</option>
            <option value="国V">国V</option>
            <option value="欧I">欧I</option>
            <option value="欧II">欧II</option>
            <option value="欧III">欧III</option>
            <option value="IV">IV</option>
            <option value="欧V">欧V</option>
            <option value="欧VI">欧VI</option>
          </select>
        </div>
        <div class="cell-car">
          <label>外观颜色</label>
          <input type="" name="carOutColor" v-bind:value="res.carOutColor"  disabled>
        </div>
        <div class="cell-car">
          <label>内饰颜色</label>
          <input type="" name="carInColor" v-bind:value="res.carInColor"  disabled>
        </div>

        <!-- <div class="cell-car">
          <label>交强险</label>
          <div class="group-radio"><input name="Fruit4" type="radio" value="" />有</div> 
          <div class="group-radio"><input name="Fruit4" type="radio" value="" />无</div> 
        </div>

        <div class="cell-car">
          <label>商业险</label>
          <div class="group-radio"><input name="Fruit5" type="radio" value="" />有</div> 
          <div class="group-radio"><input name="Fruit5" type="radio" value="" />无</div> 
        </div> -->
        <div class="cell-car">
          <label>交强险到期日期</label>
          <input type="month" name="carForceInsuranceDate" v-bind:value="res.carForceInsuranceDate | filterGetDate"  disabled>
        </div>
        <div class="cell-car">
          <label>商业险到期日期</label>
          <input type="month" name="carBusinessInsuranceDate" v-bind:value="res.carBusinessInsuranceDate | filterGetDate"  disabled>
        </div>


        <div class="cell-car">
          <label>年审到期</label>
          <input type="month" name="carValidateDate" v-bind:value="res.carValidateDate | filterGetDate"  disabled>
        </div>

        <div class="cell-car">
          <label>出厂年月</label>
          <input type="month" name="carFacotryDate" v-bind:value="res.carFacotryDate | filterGetDate" disabled>
        </div>
      </div>
    </div>
    <div class="panel">
      <div class="title">定价信息</div>
      <div class="box">
        <div class="cell-car">
          <label>零售价</label>
          <div class="group-input"><input type="" name="carRetailPrice" v-bind:value="res.carRetailPrice" disabled><span>万元</span></div>
        </div>
        <div class="cell-car">
          <label>新车指导价</label>
          <div class="group-input"><input type="" name="carGuidePrice" v-bind:value="res.carGuidePrice" disabled><span>万元</span></div>
        </div>
        <div class="cell-car">
          <label>新车完税价</label>
          <div class="group-input"><input type="" name="carTaxPrice" v-bind:value="res.carTaxPrice" disabled><span>万元</span></div>
        </div>
        <div class="cell-car">
          <label style="margin-left: 25px;">是否包含过户费</label>
          <div class="group-radio"><input name="carTransferState" type="radio" value="1" v-model="res.carTransferState"  disabled/>有</div> 
          <div class="group-radio"><input name="carTransferState" type="radio" value="0" v-model="res.carTransferState"  disabled/>无</div> 
        </div>
      </div>
    </div>


    <div class="panel">
      <div class="title">车辆描述</div>
      <div class="box">
        <!-- <div class="cell-car">
          <label style="float: left;">费用情况</label>
          <textarea></textarea>
        </div> -->
        <div class="cell-car">
          <label style="float: left;">瑕疵描述</label>
          <textarea v-bind:value="res.carFlawDesc" name="carFlawDesc" disabled></textarea>
        </div>
      </div>
    </div>



    <div class="panel">
      <div class="title">销售描述</div>
      <div class="box">
        <div class="cell">
          <div class="cell-car">
            <label>一口价</label>
            <div class="group-radio"><input name="carFixedPriceState" type="radio" value="1" v-model="res.carFixedPriceState"  disabled/>是</div> 
            <div class="group-radio"><input name="carFixedPriceState" type="radio" value="0" v-model="res.carFixedPriceState"  disabled/>否</div> 
          </div>
          <div class="cell-car">
            <label>可按揭</label>
            <div class="group-radio"><input name="carMortgageState" type="radio" value="1" v-model="res.carMortgageState"  disabled/>是</div> 
            <div class="group-radio"><input name="carMortgageState" type="radio" value="0" v-model="res.carMortgageState"  disabled/>否</div> 
          </div>
          <div class="cell-car">
            <label>特价车</label>
            <div class="group-radio"><input name="carBargainPriceState" type="radio" value="1" v-model="res.carBargainPriceState"  disabled/>是</div> 
            <div class="group-radio"><input name="carBargainPriceState" type="radio" value="0" v-model="res.carBargainPriceState"  disabled/>否</div> 
          </div>
          <div class="cell-car">
            <label>认证状态</label>
            <div class="group-radio"><input name="carAuthState" type="radio" value="1" v-model="res.carAuthState"  disabled/>已认证</div> 
            <div class="group-radio"><input name="carAuthState" type="radio" value="0" v-model="res.carAuthState"  disabled/>未认证</div> 
          </div>
<!--           <div class="cell-car">
            <label>认证状态</label>
            <div class="group-radio"><input name="carAuthState" type="radio" value="1" v-model="res.carAuthState" />已认证</div> 
            <div class="group-radio"><input name="carAuthState" type="radio" value="0" v-model="res.carAuthState" />未认证</div> 
          </div> -->
        </div>
        
        <!-- <div class="cell-car">
          <label>质保等级</label>
          <select></select>
        </div>
        <div class="cell-car">
          <label>质保费用</label>
          <div class="group-input"><input type="" name=""><span>元</span></div>
        </div> -->


        <div class="cell-car">
          <label  style="float: left;">按揭说明</label>
          <textarea v-bind:value="res.carMortgageDesc" name="carMortgageDesc" disabled></textarea>
        </div>
        <div class="cell-car">
          <label  style="float: left;">卖点描述</label>
          <textarea v-bind:value="res.carSellingPointDesc" name="carSellingPointDesc" disabled></textarea>
        </div>
      </div>
    </div>



<!--     <div class="panel">
      <div class="title">图片管理</div>
      <div class="box clearfix">
        <div class="image-list" v-for="carImage in res.carImages">
          <img v-bind:src="carImage.imageUrl">
          <div class="image-loading"></div>
          <p>{{carImage.imageKey | filterImageName}}</p>
          <input type="file"  accept="image/*" name="" v-bind:data-imageKey="carImage.imageKey" v-bind:data-imageUrl="carImage.imageUrl" v-bind:data-imageSeq="carImage.imageSeq">
        </div>
      </div>
    </div> -->


    <div class="panel">
      <div class="title">车辆保养</div>
      <div class="box">
        <div class="cell-car">
          <label style="margin-left: 20px">是否4S店定期保养</label>
          <div class="group-radio"><input name="car4sUpkeepState" type="radio" value="1" v-model="res.car4sUpkeepState"  disabled/>是</div> 
          <div class="group-radio"><input name="car4sUpkeepState" type="radio" value="0" v-model="res.car4sUpkeepState"  disabled/>否</div> 
        </div>
      </div>
    </div>

    <div class="title">车辆配置</div>
    <div class="panel">
      <div class="title">基本参数</div>
      <div class="box">
        <div class="cell-car">
          <label>厂商</label>
          <input type="" name="" v-bind:value="res.model.modelManufacturer" disabled>
        </div>
        <div class="cell-car">
          <label>级别</label>
          <select disabled>
            <option  v-for="carType in carTypeList" v-bind:value="carType.carTypeId" :selected="carType.carTypeId == res.carTypeId" >{{carType.carTypeName}}</option>
          </select>
        </div>
        <div class="cell-car">
          <label>发动机</label>
          <input type="" name="" v-bind:value="res.model.modelEngineModel" disabled>
        </div>
        <div class="cell-car">
          <label>变速箱</label>
          <input type="" name="" v-bind:value="res.model.modelGearbox" disabled>
        </div>
        <div class="cell-car">
          <label>车身结构</label>
          <input type="" name="" v-bind:value="res.model.modelBodywork" disabled>
        </div>
      </div>
    </div>

    <div class="panel">
      <div class="title">车身</div>
      <div class="box">
        <div class="cell-car">
          <label>长度</label>
          <div class="group-input"><input type="" name="" v-bind:value="res.model.modelLength" disabled><span>mm</span></div>
        </div>
        <div class="cell-car">
          <label>宽度</label>
          <div class="group-input"><input type="" name="" v-bind:value="res.model.modelWidth" disabled><span>mm</span></div>
        </div>
        <div class="cell-car">
          <label>高度</label>
          <div class="group-input"><input type="" name="" v-bind:value="res.model.modelHeight" disabled><span>mm</span></div>
        </div>
        <div class="cell-car">
          <label>轴距</label>
          <div class="group-input"><input type="" name="" v-bind:value="res.model.modelWheelbase" disabled><span>mm</span></div>
        </div>
        <div class="cell-car">
          <label>车身结构</label>
          <input type="" name="" v-bind:value="res.model.modelBody" disabled>
        </div>
      </div>
    </div>

    <div class="panel">
      <div class="title">发动机</div>
      <div class="box">
        <div class="cell-car">
          <label>发动机型号</label>
          <input type="" name="" v-bind:value="res.model.modelEngineModel" disabled>
        </div>
        <div class="cell-car">
          <label>排量</label>
          <div class="group-input"><input type="" name="" v-bind:value="res.model.modelDisplacement" disabled><span>mL</span></div>
        </div>
        <div class="cell-car">
          <label>进气形式</label>
          <input type="" name="" v-bind:value="res.model.modelInletModel" disabled>
        </div>
        <div class="cell-car">
          <label>气缸排列形式</label>
          <input type="" name="" v-bind:value="res.model.modelCylinderArray" disabled>
        </div>
        <div class="cell-car">
          <label>气缸数</label>
          <div class="group-input"><input type="" name="" v-bind:value="res.model.modelCylinderNum" disabled><span>个</span></div>
          
        </div>
        <div class="cell-car">
          <label>燃料形式</label>
          <input type="" name="" v-bind:value="res.model.modelFuelRoz" disabled>
        </div>
        <div class="cell-car">
          <label>环保标准</label>
          <input type="" name="" v-bind:value="res.model.modelEnviron" disabled>
        </div>
      </div>
    </div>

    <div class="panel">
      <div class="title">变速箱</div>
      <div class="box">
        <div class="cell-car">
          <label>变速箱类型</label>
          <input type="" name="" v-bind:value="res.model.modelGearbox" disabled>
        </div>
        <div class="cell-car">
          <label>挡位个数</label>
          <input type="" name="" v-bind:value="res.model.modelGearNum" disabled>
        </div>
      </div>
    </div>
    <div class="panel" v-for="carConf in carConfList">
      <div class="title">{{carConf.confName}}</div>
      <div class="box">
        <div class="cell-car-check" v-for="childCarConfItem in carConf.childCarConf">
          <div class="group-checkbox"><input type="checkbox" name="carConfIds" v-bind:value="childCarConfItem.confId" :checked="childCarConfItem.selectedState"  disabled>{{childCarConfItem.confName}}</div>
        </div>
      </div>
    </div>


    <div class="btn-box">
      <!-- <div class="submit"  onclick="submit()">同步配置</div> -->
      <div class="cancel" onclick="cancel()">关闭</div>
    </div>

<!--     <div class="panel">
      <div class="title">亮点配置</div>
      <div class="box">
        <div class="cell-car">
          <label style="float: left;">亮点配置</label>
          <textarea></textarea>
        </div>
      </div>
    </div> -->

    
  </form>
<div class="loading"></div>
  </body>
  <script type="text/javascript" src="../js/swiper/swiper.min.js"></script>
  <script type="text/javascript">
    var numAjax=0;
  $(document).ajaxSuccess(function(evt, request, settings){  
      numAjax++;
      if (numAjax>=5) {
        $('.loading').hide()
      }
   }); 
  function initSwiper(){
    var mySwiper = new Swiper ('.swiper-container', {
      loop: true,
      pagination: {
        el: '.swiper-pagination',
        type:'fraction',
      },
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
      autoplay: {
        delay: 3000,
      },
    })  
  }


//初始化轮播图
  




  var editCars = new Vue({
    el:'#carsForm',
    data:{
      res:null,
      Tchecked:true,
      carTypeList:[],
      shopList:[],
      regionList:[],
      carConfList:[],
      marketId:marketId,
      userId:userId,
      imgUrl:imgUrl
    },
    // created(){
    //   initSwiper();
    // }
  });
  var detialTopRight = new Vue({
    el:'#detialTopRight',
    data:{
      res:{},
    }
  })


  $.ajax({
    type: "get",      //data 传送数据类型。post 传递
    dataType: 'json',  // 返回数据的数据类型json
    url: defaultUrl+"/controller/getCarById",  // yii 控制器/方法
    cache: false,      
    data: {'carId': carId,'imageViewId':2},  //传送的数据
    error:function(){
       alert("数据传输错误");
    },success: function (data) {
      console.log(data);
      if (data.code != 1) {
        alert('数据请求失败')
        return false
      }

      editCars.res = data.result;
      detialTopRight.res = data.result;

      var imgTopHtml = '';
      var carImgList = data.result.carImages;
      if (carImgList.length == 0) {
        imgTopHtml += '<div class="swiper-slide"><img src="../images/default.png"></div>';
      }else{
        for (var i = 0; i < carImgList.length; i++) {
          imgTopHtml += '<div class="swiper-slide"><img src="'+ editCars.imgUrl + carImgList[i].imageUrl +'.r_400xh_300"></div>';
        }
      }
      $('#swiperTop').html(imgTopHtml);
      initSwiper();


      getCarConf();



    }
  });
  $.ajax({
      type: "get",      //data 传送数据类型。post 传递
      dataType: 'json',  // 返回数据的数据类型json
      url: defaultUrl+"/controller/getCarTypeList",  // yii 控制器/方法
      cache: false,      
      // data: {tel: tel},  //传送的数据
      error:function(){
         alert("数据传输错误");
      },success: function (data) {
        console.log(data);
         if (data.code != 1) {
          return false
         }
         editCars.carTypeList = data.result;
      }
  });
  $.ajax({
    type: "get",      //data 传送数据类型。post 传递
    dataType: 'json',  // 返回数据的数据类型json
    url: defaultUrl+"/controller/getShopList",  // yii 控制器/方法
    cache: false,      
    data: {'marketId': marketId},  //传送的数据
    error:function(){
       alert("数据传输错误");
    },success: function (data) {
      console.log(data);
       if (data.code != 1) {
        return false
       }
       editCars.shopList = data.result;
    }
  });
  $.ajax({
    type: "get",      //data 传送数据类型。post 传递
    dataType: 'json',  // 返回数据的数据类型json
    url: defaultUrl+"/controller/getRegionList",  // yii 控制器/方法
    cache: false,      
    data: {'marketId': marketId},  //传送的数据
    error:function(){
       alert("数据传输错误");
    },success: function (data) {
      console.log(data);
       if (data.code != 1) {
        return false
       }
       editCars.regionList = data.result;
    }
  });
  function getCarConf(){
    $.ajax({
      type: "get",      //data 传送数据类型。post 传递
      dataType: 'json',  // 返回数据的数据类型json
      url: defaultUrl+"/controller/getCarConfById",  // yii 控制器/方法
      cache: false,      
      data: {'carId': editCars.res.carId},  //传送的数据
      error:function(){
         alert("数据传输错误");
      },success: function (data) {
        console.log(data);
         if (data.code != 1) {
          return false
         }
         editCars.carConfList = data.result;
      }
    });
  };
  function cancel(){
    // window.history.go(-1);
    parent.closeTab(editCars.res.carId)
  }
  // function submit(){
  //   var formData = $('#carsForm').serialize();
  //   var imagesJson = '&carImageJson=['
  //   $('.image-list input').each(function(index){
  //     var imageKey = $(this).attr('data-imageKey')
  //     var imageUrl = $(this).attr('data-imageUrl')
  //     var imageSeq = $(this).attr('data-imageSeq')
  //     var imageJson = '{"imageKey":"'+imageKey+'","imageUrl":"'+imageUrl+'","imageSeq":'+imageSeq+'},';
  //     imagesJson += imageJson;
  //   });
  //   imagesJson += ']';

  //   var imagesData = encodeURI(imagesJson);
  //   console.log('formData:'+formData);
  //   $.ajax({
  //     type: "get",      //data 传送数据类型。post 传递
  //     dataType: 'json',  // 返回数据的数据类型json
  //     url: defaultUrl+"/controller/updateCar",  // yii 控制器/方法
  //     cache: false,  
  //     data:formData+imagesData,  
  //     error:function(){
  //        alert("数据传输错误");
  //     },success: function (data) {
  //       console.log(data);
  //        if (data.code != 1) {
  //         return false
  //        }
  //        alert('修改成功！');
  //     }
  //   });
  // }


  // $(document).on('change','.image-list input',function(){
  //     var pic = $(this)[0].files[0];
  //     var _this = $(this);
  //     var _thisImg = $(this).parent('.image-list').find('img');
  //     var _thisParent = $(this).parent('.image-list').find('.image-loading').show();
  //     var fd = new FormData();
  //     fd.append('uploadFile', pic);
  //     $.ajax({
  //         url:defaultUrl + "/controller/upload/uploadFile",
  //         type:"post",
  //         // Form数据
  //         data: fd,
  //         dataType: 'json',  // 返回数据的数据类型json
  //         cache: false,
  //         contentType: false,
  //         processData: false,
  //         success:function(data){
  //           console.log(data);
  //           _thisParent.hide();
  //           if (data.code != 1) {
  //             return false
  //            }
  //            var reader = new FileReader();  
  //             reader.onload = function(evt){  
  //               _thisImg.attr('src',evt.target.result);  
  //             } 
  //             reader.readAsDataURL(pic); 

  //             _this.attr('data-imageUrl',imgUrl + data.result.pathUrl);


  //         },
  //         error:function(){
  //           _thisParent.hide();
  //           alert('上传失败');
  //         }
  //     }); 
  // })


  </script>

</html>


































